package com.butterfly.hotkey.dashboard.biz.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * key操作记录表
 * </p>
 *
 * @author butterfly
 * @since 2024-11-05
 */
@TableName("hk_key_record")
public class KeyRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * key
     */
    private String keyName;

    /**
     * 所属appName
     */
    private String appName;

    /**
     * value
     */
    private String val;

    /**
     * 缓存时间
     */
    private Integer duration;

    /**
     * 来源
     */
    private String source;

    /**
     * 记录类型：1put；2del; -1unkonw
     */
    private Integer type;

    /**
     * 防重ID
     */
    private String uuid;

    /**
     * 规则
     */
    private String rule;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String creator;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 更新人
     */
    private String updater;


    public Long getId() {
        return id;
    }

    public KeyRecord setId(Long id) {
        this.id = id;
        return this;
    }

    public String getKeyName() {
        return keyName;
    }

    public KeyRecord setKeyName(String keyName) {
        this.keyName = keyName;
        return this;
    }

    public String getAppName() {
        return appName;
    }

    public KeyRecord setAppName(String appName) {
        this.appName = appName;
        return this;
    }

    public String getVal() {
        return val;
    }

    public KeyRecord setVal(String val) {
        this.val = val;
        return this;
    }

    public Integer getDuration() {
        return duration;
    }

    public KeyRecord setDuration(Integer duration) {
        this.duration = duration;
        return this;
    }

    public String getSource() {
        return source;
    }

    public KeyRecord setSource(String source) {
        this.source = source;
        return this;
    }

    public Integer getType() {
        return type;
    }

    public KeyRecord setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getUuid() {
        return uuid;
    }

    public KeyRecord setUuid(String uuid) {
        this.uuid = uuid;
        return this;
    }

    public String getRule() {
        return rule;
    }

    public KeyRecord setRule(String rule) {
        this.rule = rule;
        return this;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public KeyRecord setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    public String getCreator() {
        return creator;
    }

    public KeyRecord setCreator(String creator) {
        this.creator = creator;
        return this;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public KeyRecord setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public String getUpdater() {
        return updater;
    }

    public KeyRecord setUpdater(String updater) {
        this.updater = updater;
        return this;
    }

    @Override
    public String toString() {
        return "KeyRecord{" +
                "id=" + id +
                ", keyName=" + keyName +
                ", appName=" + appName +
                ", val=" + val +
                ", duration=" + duration +
                ", source=" + source +
                ", type=" + type +
                ", uuid=" + uuid +
                ", rule=" + rule +
                ", createTime=" + createTime +
                ", creator=" + creator +
                ", updateTime=" + updateTime +
                ", updater=" + updater +
                "}";
    }
}
